<template>
    <RouterLink :to="to" custom v-slot="{ navigate, isActive }">
        <ElLink :type="isActive ? activeType : defaultType" :underline=underline @click="navigate">
            <slot />
        </ElLink>
    </RouterLink>
</template>

<script setup>
defineProps({
    to: { type: [String, Object], required: true },
    activeType: { type: String, default: 'primary' },
    defaultType: { type: String, default: 'default' },
    underline: { type: Boolean, default: false }
});
</script>